import request from '@/utils/request'

// 获取角色
export const getRoles = params => request.get('/sys/role', { params })

// 获取已启用角色
export const getRolesEnabled = () => request.get('/sys/role/list/enabled')

// 添加角色
export const addRoles = data => request.post('/sys/role', data)

// 修改角色
export const updateRole = data => request.put(`/sys/role/${data.id}`, data)

// 删除角色
export const delRole = id => request.delete(`/sys/role/${id}`)

// 角色详情
export const getPermissById = id => request.get('/sys/role/' + id)

// 分配权限
export const assignPerm = data => request.put('/sys/role/assignPrem', data)
